import 'package:get/get.dart';

import 'pic_preview_state.dart';

class PicPreviewLogic extends GetxController {
  final PicPreviewState state = PicPreviewState();

  @override
  void onInit() {
    List<String>? urlList = Get.arguments["urlList"];
    if (urlList != null) {
      state.picList.clear();
      state.picList.addAll(urlList);
    }
    int? index = Get.arguments["position"];
    state.currentIndex.value = index ?? 0;
    super.onInit();
  }
}
